﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework;

namespace GalaxyPresident
{
    class CreateUnitTask : Task
    {
        AirPort airPort;
        int unit;
        public CreateUnitTask(AirPort airPort, int unit)
        {
            this.airPort = airPort;
            this.unit = unit;
        }
        public CreateUnitTask(AirPort airPort, int unit,string resString,Color color)
        {
            this.airPort = airPort;
            this.unit = unit;
            CreateButton(resString, color);
        }
        public override bool Execute()
        {
            airPort.AddUnit(airPort.createUnit(unit));
            return true;
        }

        public override void UpdateInfo(GameTime gameTime)
        {
            button.IsEnable = airPort.isEnoughResourcesForProduce(unit);            
        }


    }
}
